package org.kisekiproject.utils {

	/**
	 * Glob match.
	 */
	public class Glob {

		private var _regExp:RegExp;

		/**
		 * Constructor
		 */
		public function Glob(pattern:String) {
			_regExp=new RegExp("^"+pattern.replace("*",".*")+"$");
		}

		/**
		 * Match against a string.
		 */
		public function match(s:String):Boolean {
			var a:Array=s.match(_regExp);

			return a!=null && a.length>0;
		}
	}
}